Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag catch rebase #39

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Flag catch rebase #39

wants to merge 38 commits into from

Conversation

rwat17
Copy link
Owner

@rwat17 rwat17 commented May 21, 2024

rebase diff

@@ -189,7 +189,7 @@ async function menuLoop(agent: AnoncredAgent) {
break;
}
} catch (error) {
if (error.isTtyError) {
if (error && typeof error === 'object' && 'isTtyError' in error && error.isTtyError) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odpal prettiera bo nie powinno byc pojedycznych ', tylko same " (na calym projekcie najlepiej, ale to po review)

@@ -12,6 +12,7 @@ import {
LogLevelDesc,
LoggerProvider,
IAsyncProvider,
safeStringifyException,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning ze nie jest uzywany

@@ -46,6 +46,17 @@ const log = LoggerProvider.getOrCreate({
level: logLevel,
});

interface ResponseError<T> extends AxiosError {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie baw sie z template jak i tak jest uzywany any pozniej

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Albo ogolnie zrob na any tak jak w dalszych testach

t.ok(out, "error thrown for forbidden endpoint truthy OK");
t.ok(out.response, "enroll admin response truthy OK");
} catch (err) {
const e = err as ResponseError<any>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie da sie zrobic } catch (err: ResponseError<any>) { ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope
Catch clause variable type annotation must be 'any' or 'unknown' if specified.ts(1196)

@@ -110,7 +111,7 @@ export class CounterpartyHTLCEndpoint implements IWebServiceEndpoint {
this.log.error(`Crash while serving ${reqTag}`, ex);
res.status(500).json({
message: "Internal Server Error",
error: ex?.stack || ex?.message,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uzyj handleRestEndpointException jak w innych endpoint

error: ex?.stack || ex?.message,
});
if (typeof ex === 'object' && ex !== null) {
if ('message' in ex && typeof ex.message === 'string') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mozna uproscic w stylu const msg = ex.message ?? "" i dalej juz includes na tym stringu

res.status(500);
res.statusMessage = ex.message;
res.json({ error: ex.stack });
if (typeof ex === 'object' && ex !== null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jeden if moze byc

error: ex?.stack || ex?.message,
});
if (typeof ex === 'object' && ex !== null) {
if ('message' in ex && typeof ex.message === 'string') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tak samo jak wczezesniej, zrob dla dalszych tak samo

error: ex?.stack || ex?.message,
});
} else {
if (typeof ex === 'object' && ex !== null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zrob jeden if gdzie sie dalej w dalszym kodzie tez

400,
`Endpoint ${fInitialize} without required connectorId: response.status === 400 OK`,
`Endpoint ${fInitialize} waithout required connectorId: response.status === 400 OK`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

literowka

@rwat17 rwat17 force-pushed the flag-catch-rebase branch from 762aa7a to af39d46 Compare May 22, 2024 16:31
@rwat17 rwat17 force-pushed the flag-catch-rebase branch 2 times, most recently from 0be22af to af39d46 Compare June 28, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants